package cn.mesmile.design.composite;

/**
 * @author zb
 * @date 2020/11/16 23:45
 * @Description:
 */
public class MainTest {

    public static void main(String[] args) {

        Root root = new Folder("C://");

        Folder desktop = new Folder("桌面");
        Folder myComputer = new Folder("我的电脑");

        Root javaFile = new File("helloworld.java");

        root.add(desktop);
        root.add(myComputer);

        myComputer.add(javaFile);

        // 第0级开始展示
        root.display(0);


        // 另外一个跟
        Root root2 = new Folder("D://");
        root2.display(0);

    }
}
